<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>FuncSDK user manual.md</title><link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}#write, body { height: auto; }
#write, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write ol, #write p, #write ul { position: relative; }
#write, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write, pre { white-space: pre-wrap; }
.CodeMirror, .md-fences, table { text-align: left; }
.md-reset, a:active, a:hover { outline: 0px; }
.md-reset, .md-toc-item a { text-decoration: none; }
.MathJax_SVG, .md-reset { float: none; direction: ltr; }
:root { --bg-color:#ffffff; --text-color:#333333; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }
.in-text-selection, ::selection { background: rgb(181, 214, 252); text-shadow: none; }
#write { margin: 0px auto; word-break: normal; word-wrap: break-word; padding-bottom: 70px; overflow-x: visible; }
.first-line-indent #write p .md-line { text-indent: 0px; }
.first-line-indent #write li, .first-line-indent #write p, .first-line-indent #write p .md-line:first-child { text-indent: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write > blockquote:first-child, #write > div:first-child, #write > ol:first-child, #write > p:first-child, #write > pre:first-child, #write > table:first-child, #write > ul:first-child { margin-top: 30px; }
#write li > table:first-child { margin-top: -20px; }
img { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
p { -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; }
.mathjax-block { margin-top: 0px; margin-bottom: 0px; -webkit-margin-before: 0px; -webkit-margin-after: 0px; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
#write > figure:first-child { margin-top: 16px; }
figure { overflow-x: auto; margin: -8px 0px 0px -8px; max-width: calc(100% + 16px); padding: 8px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; }
.CodeMirror-line, .md-fences { break-inside: avoid; }
table.md-table td { min-width: 80px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; margin-right: 4px; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
.md-fences { font-size: 0.9rem; display: block; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
.md-fences .CodeMirror.CodeMirror-wrap { top: -1.6em; margin-bottom: -1.6em; }
.md-fences.mock-cm { white-space: pre-wrap; }
.show-fences-line-number .md-fences { padding-left: 0px; }
.show-fences-line-number .md-fences.mock-cm { padding-left: 40px; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; vertical-align: top; background: 0px 0px; text-shadow: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; }
.md-toc-inner, a img, img a { cursor: pointer; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: nowrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
  #write { margin-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  h1, h2, h3, h4, h5, h6 { break-after: avoid-page; orphans: 2; }
  p { orphans: 4; }
  html.blink-to-pdf { font-size: 13px; }
  .typora-export #write { padding-left: 1cm; padding-right: 1cm; padding-bottom: 0px; break-after: avoid; }
  .typora-export #write::after { height: 0px; }
  @page { margin: 20mm 0px; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > img:only-child { display: block; margin: auto; }
.md-line > .md-image:only-child, p > .md-image:only-child { display: inline-block; width: 100%; text-align: center; }
.mathjax-block:not(:empty)::after, .md-toc-content::after, .md-toc::after { display: none; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.mathjax-block { white-space: pre; overflow: hidden; width: 100%; }
p + .mathjax-block { margin-top: -1.143rem; }
[contenteditable="true"]:active, [contenteditable="true"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.MathJax_SVG, .mathjax-block .MathJax_SVG_Display { text-indent: 0px; max-width: none; max-height: none; min-height: 0px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-inner:hover { }
.md-toc-inner { display: inline-block; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, tt { font-family: var(--monospace); }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; }
a.md-print-anchor { border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.mathjax-block .MathJax_SVG_Display { text-align: center; margin: 1em 0px; position: relative; min-width: 100%; width: auto; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: monospace; }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; zoom: 90%; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; min-width: 0px; border: 0px; padding: 0px; margin: 0px; }
.MathJax_SVG * { transition: none; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg, [lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }


.CodeMirror, .CodeMirror-sizer { position: relative; }
.CodeMirror.cm-s-inner { background: inherit; }
.fences-no-line-wrapping .md-fences .CodeMirror { margin-top: -30px; }
.CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; }
.CodeMirror-lines { padding: 4px 0px; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-scroll, .cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta, .cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error, .cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.CodeMirror { height: auto; overflow: hidden; }
.CodeMirror-scroll { margin-bottom: -30px; padding-bottom: 30px; height: 100%; outline: 0px; position: relative; box-sizing: content-box; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow-x: hidden; overflow-y: scroll; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow-y: hidden; overflow-x: scroll; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; word-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; border-right: none; width: 0px; visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.CodeMirror-selected { background: rgb(217, 217, 217); }
.CodeMirror-focused .CodeMirror-selected { background: rgb(215, 212, 240); }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}
.CodeMirror-lint-markers { width: 16px; }
.CodeMirror-lint-tooltip { background-color: infobackground; border: 1px solid rgb(0, 0, 0); border-radius: 4px; color: infotext; font-family: var(--monospace); overflow: hidden; padding: 2px 5px; position: fixed; white-space: pre-wrap; z-index: 10000; max-width: 600px; opacity: 0; transition: opacity 0.4s; font-size: 0.8em; }
.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { background-position: left bottom; background-repeat: repeat-x; }
.CodeMirror-lint-mark-error { background-image: url(""); }
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { background-position: center center; background-repeat: no-repeat; cursor: pointer; display: inline-block; height: 16px; width: 16px; vertical-align: middle; position: relative; }
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { padding-left: 18px; background-position: left top; background-repeat: no-repeat; }
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { background-image: url(""); }
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { background-image: url(""); }
.CodeMirror-lint-marker-multiple { background-image: url(""); background-repeat: no-repeat; background-position: right bottom; width: 100%; height: 100%; }


:root { --side-bar-bg-color: #fafafa; --control-text-color: #777; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: normal; src: local("Open Sans Regular"), url("./github/400.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: normal; src: local("Open Sans Italic"), url("./github/400i.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: bold; src: local("Open Sans Bold"), url("./github/700.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: bold; src: local("Open Sans Bold Italic"), url("./github/700i.woff") format("woff"); }
html { font-size: 16px; }
body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
#write { max-width: 860px; margin: 0px auto; padding: 20px 30px 100px; }
#write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
body > :first-child { margin-top: 0px !important; }
body > :last-child { margin-bottom: 0px !important; }
a { color: rgb(65, 131, 196); }
h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
h1 tt, h1 code { font-size: inherit; }
h2 tt, h2 code { font-size: inherit; }
h3 tt, h3 code { font-size: inherit; }
h4 tt, h4 code { font-size: inherit; }
h5 tt, h5 code { font-size: inherit; }
h6 tt, h6 code { font-size: inherit; }
h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid rgb(238, 238, 238); }
h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid rgb(238, 238, 238); }
h3 { font-size: 1.5em; line-height: 1.43; }
h4 { font-size: 1.25em; }
h5 { font-size: 1em; }
h6 { font-size: 1em; color: rgb(119, 119, 119); }
p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
li > ol, li > ul { margin: 0px; }
hr { height: 4px; padding: 0px; margin: 16px 0px; background-color: rgb(231, 231, 231); border-width: 0px 0px 1px; border-style: none none solid; border-top-color: initial; border-right-color: initial; border-left-color: initial; border-image: initial; overflow: hidden; box-sizing: content-box; border-bottom-color: rgb(221, 221, 221); }
body > h2:first-child { margin-top: 0px; padding-top: 0px; }
body > h1:first-child { margin-top: 0px; padding-top: 0px; }
body > h1:first-child + h2 { margin-top: 0px; padding-top: 0px; }
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { margin-top: 0px; padding-top: 0px; }
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0px; padding-top: 0px; }
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { margin-top: 0px; }
li p.first { display: inline-block; }
ul, ol { padding-left: 30px; }
ul:first-child, ol:first-child { margin-top: 0px; }
ul:last-child, ol:last-child { margin-bottom: 0px; }
blockquote { border-left: 4px solid rgb(221, 221, 221); padding: 0px 15px; color: rgb(119, 119, 119); }
blockquote blockquote { padding-right: 0px; }
table { padding: 0px; word-break: initial; }
table tr { border-top: 1px solid rgb(204, 204, 204); margin: 0px; padding: 0px; }
table tr:nth-child(2n) { background-color: rgb(248, 248, 248); }
table tr th { font-weight: bold; border-width: 1px 1px 0px; border-top-style: solid; border-right-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-image: initial; border-bottom-style: initial; border-bottom-color: initial; text-align: left; margin: 0px; padding: 6px 13px; }
table tr td { border: 1px solid rgb(204, 204, 204); text-align: left; margin: 0px; padding: 6px 13px; }
table tr th:first-child, table tr td:first-child { margin-top: 0px; }
table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); }
.md-fences, code, tt { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; }
.md-fences { margin-bottom: 15px; margin-top: 15px; padding: 8px 1em 6px; }
.md-task-list-item > input { margin-left: -1.3em; }
@media screen and (min-width: 914px) {
}
@media print {
  html { font-size: 13px; }
  table, pre { break-inside: avoid; }
  pre { word-wrap: break-word; }
}
.md-fences { background-color: rgb(248, 248, 248); }
#write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
.mathjax-block > .code-tooltip { bottom: 0.375rem; }
#write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
#write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
.md-image > .md-meta { border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 0px 0px 4px; font-size: 0.9em; color: inherit; }
.md-tag { color: inherit; }
.md-toc { margin-top: 20px; padding-bottom: 20px; }
.sidebar-tabs { border-bottom: none; }
#typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
#typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
#md-notification::before { top: 10px; }
.on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
.file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
.mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
.md-lang { color: rgb(180, 101, 77); }
.html-for-mac .context-menu { --item-hover-bg-color: #E6F0FE; }





 .typora-export p {white-space: normal;} 
</style>
</head>
<body class='typora-export' >
<div  id='write'  class = 'is-node'><h3><a name='header-n0' class='md-header-anchor '></a>FuncSDK使用说明书</h3><h4><a name='header-n2' class='md-header-anchor '></a>1. 概述</h4><p>FuncSDK是EwayOS的编程接口SDK，主要包含emake、文档、example部分。 </p><h4><a name='header-n5' class='md-header-anchor '></a>2. Function结构介绍</h4><p>Function是EwayOS中的具体功能层，Function连接HighLevelAI获取机器人检测消息，连接LowLevelAI获得机器人运动控制。Function框架主要机制如下：</p><h5><a name='header-n8' class='md-header-anchor '></a>(1) Message机制</h5><p>Function内部使用MessageList机制，所有消息（包含HighLevelAI检测到的周边数据，LowLevelAI发送的运动数据以及Function内部的Timer数据、自定义消息数据）均按到达时间及优先级加入一个消息队列，每个Function内部均存在在一个消息处理线程，该线程读取此消息列表，串行处理各消息。</p><p>对于自定义消息，首先定义消息码，FunMsg_User之后的数字均可使用。之后在cpp文件中添加消息响应函数，最后在cpp文件中BEGIN_FIFEMSG_MAP与END_FIFMSG_MAP宏之间添加消息映射。</p><h5><a name='header-n13' class='md-header-anchor '></a><em>Example：</em></h5><p>在头文件中添加</p><pre class="md-fences md-end-block" lang="c++"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><span><span>​</span>x</span></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#define MuFunMsg FunMsg_User+1</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">eint</span> <span class="cm-def">OnMyMessage</span>(<span class="cm-variable">eint</span><span class="cm-operator">&amp;</span> <span class="cm-variable">nMsgCode</span>,<span class="cm-variable">edouble</span><span class="cm-operator">&amp;</span> <span class="cm-variable">dTimeStamp</span>,<span class="cm-variable">eint</span><span class="cm-operator">&amp;</span> <span class="cm-variable">nParam1</span>,<span class="cm-variable">eint</span><span class="cm-operator">&amp;</span> <span class="cm-variable">nParam2</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">MSG_FIFMAP</span>(<span class="cm-variable">MuFunMsg</span>,<span class="cm-variable">OnMyMessage</span>)<span class="cm-comment">//在.cpp文件中END_FIFMSG_MAP前添加</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">END_FIFMSG_MAP</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 169px;"></div><div class="CodeMirror-gutters" style="display: none; height: 199px;"></div></div></div></pre><p>之后在调用<a href='FuncInterface/PushIntoMsgList.html'>PushIntoMsgList</a>即可将消息插入消息队列，消息处理线程会自动调用OnMyMessage处理消息。 </p><h5><a name='header-n19' class='md-header-anchor '></a>(2) Feature机制</h5><p>Feature为Function向HighLevelAI请求某项识别、检测功能所使用。Function欲开启某项识别或检测功能时，需在<a href='FuncInterface/Initialize.html'>Initialize</a>时或Function运行的任何时间内调用<a href='FuncInterface/RequestFeature.html'>RequestFeature</a>请求Feature，请求成功后Function模块即会收到对应的识别、检测消息，此时框架回调用<a href='FuncInterface/CheckMsgCode.html'>CheckMessageCode</a>回调询问处理方式，若<a href='FuncInterface/CheckMsgCode.html'>CheckMessageCode</a>返回MsgProcCode_Ignore，该消息会被直接丢弃; 若返回MsgProcCode_Notify，框架回调用对应的Proc开头的函数进行回调通知;  若返回MsgProcCode_Record，框架会将消息数据存储，Function模块可调用<a href='FuncInterface/GetMsgData.html'>GetMsgData</a>函数获取最新一次消息数据。</p><p>所有请求成功的Feature应在不需要该功能时再次调用<a href='FuncInterface/RequestFeature.html'>RequestFeature</a>关闭。</p><p>关闭Feature应在<a href='FuncInterface/JobStart.html'>JobStart</a>后，在调用<a href='FuncInterface/Uninitialize.html'>Uninitialize</a>前。在不需要该功能时随时关闭，若本Function模块可被父Function强制关闭，则应在<a href='FuncInterface/ProcCloseCmd.html'>ProcCloseCmd</a>中关闭Feature。</p><p>若请求Feature成功后HighLevelAI掉线，Function不需重新请求Feature，框架会在HighLevelAI上线后自动重新请求。</p><p>若在Function请求Feature成功后，由于Sensor原因造成Feature检测错误，Function会收到<a href='FuncInterface/ProcFeatureStatus.html'>ProcFeatureStatus</a>回调。</p><p>目前支持的<a href='FeatureList.html'>FeatureCode</a>。</p><h5><a name='header-n32' class='md-header-anchor '></a>(3) Initialize机制</h5><p>Function在启动时必须要初始化资源，等资源初始化完成之后，系统会调入<a href='FuncInterface/JobStart.html'>JobStart</a>函数，开始Function真正的工作。</p><p><a href='FuncInterface/Initialize.html'>Initialize</a>为Function初始化函数，它有三个参数，FeatureList(需要申请的资源列表)、LimbAuthority(机器人肢体控制权)和TimeOut(Function等待框架处理申请的时间(s))。用户需要填入本Function能正常运行所需要的所有Feature和Limb请求权限，等系统申请成功后会自动调入JobStart中，如果系统没有申请成功且TimeOut没有赋值，则Function会处于一直等待的状态；如果申请没有成功但TimeOut有赋值，则会在等待时间后进入<a href='FuncInterface/JobFailed.html'>JobFailed</a>。</p><p>如果在初始化时，没有填入任何Feature并且没有把LimbAuthority设置为true，表示Function不需要Sensor的Feature数据和LowLevelAI的Limb控制权，系统会直接调入JobStart中，开始Function的工作。</p><h5><a name='header-n39' class='md-header-anchor '></a>(4) Command机制</h5><p>Command为Function向LowLevelAI发送运动指令，控制机器人运动所使用。</p><p>Command欲控制机器人运动时，可调用Send系列函数发送运动命令。LowLevelAI收到Send系列控制函数后，首先检查权限，权限正常后及发送返回值至Function，运动函数返回，此时机器人还未开始运动，之后LowLevelAI开始规划运动轨迹，发送电机指令控制机器人运动。当指令发送完毕，等待下位机执行结束后，LowLevelAI会发送<a href='Messages/CCmdDoneMessage.html'>CommandDone</a>消息至Function，通知Function该指令执行完毕。Function使用CmdSN识别<a href='Messages/CCmdDoneMessage.html'>CommandDone</a>与之前发送的运动指令。</p><p>若在Function请求肢体控制权成功后，由于LowLevelAI下线或其它高优先级Function上下线原因造成肢体控制权变化，Function会收到<a href='FuncInterface/ProcAuthChanged.html'>ProcAuthChanged</a>回调。</p><h5><a name='header-n46' class='md-header-anchor '></a><em>备注：</em></h5><ol start='' ><li><a href='Messages/CCmdDoneMessage.html'>CommandDone</a>消息可能会传递执行失败消息，（m_nCmdStatus不为0）。此时m_nCmdStatus变量存储错误码。</li><li>对于控制电机速度系列指令（<a href='FuncInterface/SendWheelStraightSpeed.html'>SendWheelStraightSpeed</a>，<a href='FuncInterface/SendWheelCycleSpeed.html'>SendWheelCycleSpeed</a>，<a href='FuncInterface/SendMotorSpeed.html'>SendMotorSpeed</a>），<a href='Messages/CCmdDoneMessage.html'>CommandDone</a>消息会立刻发出，指令若未被后续指令取消，会持续执行2.4s。 </li></ol><h5><a name='header-n54' class='md-header-anchor '></a>(5) 子Function机制</h5><p>Function模块共有两种编写方式，一种生成独立app（emake -t fapp）或编译为lib库（emake -t flib），当编译为lib库时，该Function可作为子Function被其它Function调用（app及lib均可）。调用方式为父Function调用<a href='FuncInterface/AddChildFun.html'>AddChildFun</a>函数，参数传入被调用lib库名去掉lib前缀及.so后缀。框架会自动实例化该子Function模块，将其连入HighLevelAI及LowLevelAI，子Function可获取消息数据，可发送肢体控制指令控制机器人运动。</p><p>父Function与子Function通过参数进行通信。参数在传递过程中被序列化为json字符串，用户可调用<a href='FuncInterface/SetParamStr.html'>SetParamStr</a>函数将参数对序列化为json字符串，父Function可随时调用<a href='FuncInterface/SetChildParam.html'>SetChildParam</a>函数向子Function发送参数，子Function收到参数后框架会调用<a href='FuncInterface/ProcSetFunParam.html'>ProcSetFunParam</a>进行通知，子Function可调用GetParam系列函数解析json串，获取最终的参数数值。</p><p>子Function退出可选择两种方式，主动退出或被动退出。主动退出为子Function任务执行完毕，关闭Feature及肢体控制权，显式调用<a href='FuncInterface/FunQuit.html'>FunQuit</a>函数通知父Function退出。调用<a href='FuncInterface/FunQuit.html'>FunQuit</a>后，框架回调用子Function的<a href='FuncInterface/Uninitialize.html'>Uninitialize</a>函数，之后关闭消息处理线程，子Function退出。框架会调用父Function的<a href='FuncInterface/ProcChildFunQuit.html'>ProcChildFunQuit</a>回调通知父Function。被动退出为父Function调用<a href='FuncInterface/PostStopCmdToAllChildFun.html'>PostStopCmdToAllChildFun</a>或<a href='FuncInterface/PostStopCmdToChildFunByID.html'>PostStopCmdToChildFunByID</a>函数通知子Function退出，框架会调用子Function的<a href='FuncInterface/ProcCloseCmd.html'>ProcCloseCmd</a>回调通知子Function，此时子Function应立刻关闭Feature及肢体控制权，关闭timer，尽快调用<a href='FuncInterface/FunQuit.html'>FunQuit</a>退出。调用FunQuit之后的流程与主动退出相同。</p><p>子Function推出后可传递ResultStr至父Function，ResultStr同样使用json串，函数可调用<a href='FuncInterface/SetParamStr.html'>SetParamStr</a>序列化参数对，使用GetParam系列函数解析json串。</p><p>GetParam系列的函数包括：<a href='FuncInterface/GetParamStrVal.html'>GetParamStrVal</a>、<a href='FuncInterface/GetParamIntVal.html'>GetParamIntVal</a>、<a href='FuncInterface/GetParamFloatVal.html'>GetParamFloatVal</a>、<a href='FuncInterface/GetParamGuidVal.html'>GetParamGuidVal</a>。</p><h5><a name='header-n65' class='md-header-anchor '></a>(6) Timer机制</h5><p>Function可使用<a href='FuncInterface/SetTimer.html'>SetTimer</a>函数开关计时器，参数为间隔ms数。当间隔时间到达后，框架会向Function消息队列中插入一条Timer事件，当消息处理线程处理此消息时，会调用<a href='FuncInterface/ProcTimer.html'>ProcTimer</a>函数进行处理。</p><p><strong><em>注：</em></strong></p><p>此Timer为非精准Timer，时间间隔为传递消息的最小时间间隔。</p><p>若由于程序问题造成消息处理线程响应不及时，可能会造成Timer事件在队列中累计，出现一个时段无<a href='FuncInterface/ProcTimer.html'>ProcTimer</a>，另一时段<a href='FuncInterface/ProcTimer.html'>ProcTimer</a>函数频繁调用。</p><h5><a name='header-n74' class='md-header-anchor '></a>(7) 自定义Message机制</h5><p>FunctionSDK为自定义Message提供一种临时解决方案。用户可以根据需求自定义Feature和Message，自定义的Message必须继承CBaseMessage类，并实现其中的Serilize，Deserilize，opreator ＝，clear和copy函数, 详情请参看<a href='../FuncSDK/Messages/%E8%87%AA%E5%AE%9A%E4%B9%89Message%E7%A4%BA%E4%BE%8B.html'>自定义Message示例</a>。在EwayOS中Sensor产生的数据最终会流入到Function模块中，如果想在Function中接收Sensor中自定义的Message需要在Function中注册这个Message，两个模块引用相同的自定义Message头文件，注册的方式为在cpp文件中加入宏定义，如要在Fucntion中自定义一个CMyMessgae类型的消息，其FeatureCode为1071，消息的描述为“msginfo”，定义方式如下：</p><pre class="md-fences md-end-block" lang=""> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">RegisterMessage_Start</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">RegisterMessage(1071,CMyMessage,"msginfo")</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">RegisterMessage_End</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 123px;"></div><div class="CodeMirror-gutters" style="display: none; height: 153px;"></div></div></div></pre><p>其中CMyMessga必须为CBaseMessage的子类。自定义Message跟框架中原有的Message一样，提供两种通知方式，Notify和Record。其中Record方式稍有不同，在调用GetUserData时需要传入两个参数MessageCode和CBaseMessage的指针，当GetUserData返回为ture时框架会把消息拷贝到CBaseMessage的指针指向的内存中。如要没有自定义的Message只须要把中间的一行删除掉即可。</p><p>在自定义的Message的编写过程中存在bug会引起程序崩溃，所以这种方式要求用户有较高的编码和调试能力，EwayOS会在近期提供一种更高效安全的方式来解决这个问题。</p><h5><a name='header-n82' class='md-header-anchor '></a>(8) 时间同步机制</h5><p>用户在使用Function过程中难免会遇到跨机使用或是连接模拟器的场景，在这种情况下目标机器的时间与本机的时间会有偏差，这种偏差会给用户在编写逻辑时带来各种各样的问题。时间同步机制用来解决在跨机或是连接模拟器的情况下时间不同步问题。
Function连接本机的机器人时，这时不需要时间同步。Function跨机连接的机器人时，这时远端的LowLevelAI将系统时间发送给Function（只发送一次），Function框架收到后计算时间差做校准，在Function中调ewayos::Time::GetCurrentTime()来获取同步后机器人系统时间。
Function连接的本机的模拟器时，EwaySimulator将模拟器的时间实时的写入到共享内存中，Function的框架来实时读取以实时校准机器人系统时间。Function跨机连接的模拟器时，EwaySimulator将模拟器的时间不断的发送给Function，Function框架收到后入到共享变量中(不是共享内存的原因是为了防止本机出现多个Function，造成相互干扰)，Function中调ewayos::Time::GetCurrentTime()来获取同步后机器人系统时间。</p><p>时间同步方案存在一定的误差，跨机时与目标机器的时间并不是完全一致。连接模拟器时，如果模拟器中的世界处于暂停状态，那从Function上ewayos::Time::GetCurrentTime()得到的时间也是静止的。连接模拟器时，如果模拟器中的时间运行的特别慢，那从Function上ewayos::Time::Sleep()和ProcTimer()都会特别慢。</p><p>ewayos::Time::Sleep(), ewayos::Time::GetCurrentTime(),这两个接口使用的是时间同步机制,使用的是机器人系统 时间。同时也保留了:ewaos::Time::SystemSleep(), ewayos::Time::GetSystemTime()
来获取计算机的本机时间。</p><p>&nbsp;</p><p>&nbsp;</p><h4><a name='header-n96' class='md-header-anchor '></a>3. 编程接口说明</h4><h5><a name='header-n97' class='md-header-anchor '></a>(1) <a href='FuncInterface/Initialize.html'>Initialize</a></h5><p>模块初始化函数，此函数会在所有函数调用前调用，在这里填入Function运行里所需要的资源。</p><h5><a name='header-n100' class='md-header-anchor '></a>(2) <a href='FuncInterface/Uninitialize.html'>Uninitialize</a></h5><p>模块销毁函数，此函数会在销毁前最后一个调用。 </p><h5><a name='header-n103' class='md-header-anchor '></a>(3) <a href='FuncInterface/CheckMsgCode.html'>CheckMsgCode</a></h5><p>获取Sensor消息处理方式。获取本模块对传入消息处理方式。返回值可选择方式如下： </p><h5><a name='header-n106' class='md-header-anchor '></a>(4) <a href='FuncInterface/JobStart.html'>JobStart</a></h5><p>初始化完后自动调入，表示Function 开始工作。 </p><h5><a name='header-n109' class='md-header-anchor '></a>(5) <a href='FuncInterface/JobFailed.html'>JobFailed</a></h5><p>初始化失败，Function结束工作。 </p><h5><a name='header-n112' class='md-header-anchor '></a>(6) <a href='FuncInterface/SetTimer.html'>SetTimer</a></h5><p>开启或关闭一个定时器。</p><h5><a name='header-n115' class='md-header-anchor '></a>(7) <a href='FuncInterface/ProcTimer.html'>ProcTimer</a></h5><p>定时器触发通知。</p><h5><a name='header-n118' class='md-header-anchor '></a>(8) <a href='FuncInterface/AddChildFun.html'>AddChildFun</a></h5><p>调用其它Function模块（Function动态库）。该函数可加载其它编写好的Function动态库，被调用动态库将使用此Function进程所拥有的HighLevelAI及LowLevelAI连接，获取机器人数据以及控制机器人运动。</p><h5><a name='header-n121' class='md-header-anchor '></a>(9) <a href='FuncInterface/SetChildParam.html'>SetChildParam</a></h5><p>对已加载子Function模块发送Parameter数据。</p><h5><a name='header-n124' class='md-header-anchor '></a>(10) <a href='FuncInterface/SetParamStr.html'>SetParamStr</a></h5><p>拼装发送至Function模块的参数字符串。</p><h5><a name='header-n127' class='md-header-anchor '></a>(11) <a href='FuncInterface/ProcSetFunParam.html'>ProcSetFunParam</a></h5><p>收到外部（框架或父Function）发送的Paramter。</p><h5><a name='header-n130' class='md-header-anchor '></a>(12) <a href='FuncInterface/GetParamIntVal.html'>GetParamIntVal</a></h5><p>解析Json字符串，得到eint型数据。</p><h5><a name='header-n133' class='md-header-anchor '></a>(13) <a href='FuncInterface/GetParamStrVal.html'>GetParamStrVal</a></h5><p>解析Json字符串，得到string型数据。</p><h5><a name='header-n136' class='md-header-anchor '></a>(14) <a href='FuncInterface/GetParamStrVal.html'>GetParamGuidVal</a></h5><p>解析Json字符串，得到GUID型数据。</p><h5><a name='header-n139' class='md-header-anchor '></a>(15) <a href='FuncInterface/GetParamFloatVal.html'>GetParamFloatVal</a></h5><p>解析Json字符串，得到efloat型数据。</p><h5><a name='header-n142' class='md-header-anchor '></a>(16) <a href='FuncInterface/PostStopCmdToAllChildFun.html'>PostStopCmdToAllChildFun</a></h5><p>向所有子Function发送Close指令</p><h5><a name='header-n145' class='md-header-anchor '></a>(17) <a href='FuncInterface/PostStopCmdToChildFunByID.html'>PostStopCmdToChildFunByID</a></h5><p>向某一子Function发送Close指令 </p><h5><a name='header-n148' class='md-header-anchor '></a>(18) <a href='FuncInterface/FunQuit.html'>FunQuit</a></h5><p>向父Funtion发送关闭通知。</p><h5><a name='header-n151' class='md-header-anchor '></a>(19) <a href='FuncInterface/Destroy.html'>Destroy</a></h5><p>当Function被销毁时，框架调用此函数。</p><h5><a name='header-n154' class='md-header-anchor '></a>(20) <a href='FuncInterface/ProcChildFunQuit.html'>ProcChildFunQuit</a></h5><p>子Function退出回调，此Function模块调用的某一子Function已运行结束。</p><h5><a name='header-n157' class='md-header-anchor '></a>(21) <a href='FuncInterface/ProcCloseCmd.html'>ProcCloseCmd</a></h5><p>收到父Function或框架发送的关闭指令。</p><h5><a name='header-n160' class='md-header-anchor '></a>(22) <a href='FuncInterface/RequestFeature.html'>RequestFeature</a></h5><p>向HighLevelAI发送消息通知请求。发送此命令应在HighLevelAI上线后。</p><h5><a name='header-n163' class='md-header-anchor '></a>(23) <a href='FuncInterface/ProcVoiceMsg.html'>ProcVoiceMsg</a></h5><p>收到语音识别消息回调</p><h5><a name='header-n166' class='md-header-anchor '></a>(24) <a href='FuncInterface/ProcVisionObj.html'>ProcVisionObj</a></h5><p>收到物体识别消息回调</p><h5><a name='header-n169' class='md-header-anchor '></a>(25) <a href='FuncInterface/ProcVisionMarker.html'>ProcVisionMarker</a></h5><p>收到Marker识别消息回调</p><h5><a name='header-n172' class='md-header-anchor '></a>(26) <a href='FuncInterface/ProcVisionFace.html'>ProcVisionFace</a></h5><p>收到人脸识别或检测消息回调</p><h5><a name='header-n175' class='md-header-anchor '></a>(27) <a href='FuncInterface/ProcObstMsg.html'>ProcObstMsg</a></h5><p>收到障碍检测消息回调</p><h5><a name='header-n178' class='md-header-anchor '></a>(28) <a href='FuncInterface/ProcArmPos.html'>ProcArmPos</a></h5><p>收到手臂移动消息回调</p><h5><a name='header-n181' class='md-header-anchor '></a>(29) <a href='FuncInterface/ProcRobPos.html'>ProcRobPos</a></h5><p>收到位置移动消息回调</p><h5><a name='header-n184' class='md-header-anchor '></a>(30) <a href='FuncInterface/ProcHeadPos.html'>ProcHeadPos</a></h5><p>收到头部移动消息回调</p><h5><a name='header-n187' class='md-header-anchor '></a>(31) <a href='FuncInterface/ProcSystemError.html'>ProcSystemError</a></h5><p>收到机器人错误状态</p><h5><a name='header-n190' class='md-header-anchor '></a>(32) <a href='FuncInterface/ProcLaserMsg.html'>ProcLaserMsg</a></h5><p>收到激光的数据</p><h5><a name='header-n193' class='md-header-anchor '></a>(33) <a href='FuncInterface/ProcIMUMsg.html'>ProcIMUMsg</a></h5><p>收到IMU的数据</p><h5><a name='header-n195' class='md-header-anchor '></a>(34) <a href='FuncInterface/ProcUserMessage.html'>ProcUserMessage</a></h5><p>收到用户发出的数据</p><h5><a name='header-n199' class='md-header-anchor '></a>(35) <a href='FuncInterface/GetMsgData.html'>GetMsgData</a></h5><p>当CheckMsgCode返回MsgProcCode_Record时，消息数据会被记录，调用GetMsgData可返回最新一次记录的数据。</p><h5><a name='header-n202' class='md-header-anchor '></a>(36) <a href='FuncInterface/ProcFeatureStatus.html'>ProcFeatureStatus</a></h5><p>HighLevel中Feature状态改变通知。此消息一般由Sensor状态改变触发。</p><h5><a name='header-n205' class='md-header-anchor '></a>(37) <a href='FuncInterface/SendAuthorityReq.html'>SendAuthorityReq</a></h5><p>向LowLevelAI发送肢体控制请求。此命令应在LowLevelAI上线后发送。</p><h5><a name='header-n208' class='md-header-anchor '></a>(38) <a href='FuncInterface/ProcAuthChanged.html'>ProcAuthChanged</a></h5><p>LowLevelAI发送的肢体控制权变化。</p><h5><a name='header-n211' class='md-header-anchor '></a>(39) <a href='FuncInterface/ProcMotCmdDone.html'>ProcMotCmdDone</a></h5><p>Function发送的肢体命令已响应完毕，肢体运动结束。</p><h5><a name='header-n214' class='md-header-anchor '></a>(40) <a href='FuncInterface/SendSpeakerPlayText.html'>SendSpeakerPlayText</a></h5><p>发送SpealerPlayText指令至LowLevelAI，机器人将运行Text To Speech模块进行语音转换并播放。</p><h5><a name='header-n217' class='md-header-anchor '></a>(41) <a href='FuncInterface/SendHeadMove.html'>SendHeadMove</a></h5><p>发送SendHeadMove指令至LowLevelAI，机器人将根据指令数据移动头部。</p><h5><a name='header-n220' class='md-header-anchor '></a>(42) <a href='FuncInterface/SendHeadMoveSync.html'>SendHeadMoveSync</a></h5><p>发送SendHeadMoveSync指令至LowLevelAI，机器人将根据指令数据移动头部</p><h5><a name='header-n223' class='md-header-anchor '></a>(43) <a href='FuncInterface/SendHeadStop.html'>SendHeadStop</a></h5><p>发送SendHeadStop指令至LowLevelAI，机器人将根据指令立刻停止头部运动。</p><h5><a name='header-n226' class='md-header-anchor '></a>(44) <a href='FuncInterface/SendWheelGoToPosition.html'>SendWheelGoToPosition</a></h5><p>发送SendWheelGoToPosition指令至LowLevelAI，机器人底盘将根据目标点进行运动。</p><h5><a name='header-n229' class='md-header-anchor '></a>(45) <a href='FuncInterface/SendWheelBrake.html'>SendWheelBrake</a></h5><p>发送SendWheelBrake指令至LowLevelAI，机器人双轮立即进行减速刹车。</p><h5><a name='header-n232' class='md-header-anchor '></a>(46) <a href='FuncInterface/SendWheelStraight.html'>SendWheelStraight</a></h5><p>发送SendWheelStraight指令至LowLevelAI，机器人底盘将进行位置模式的直线运动。</p><h5><a name='header-n235' class='md-header-anchor '></a>(47) <a href='FuncInterface/SendWheelStraightSpeed.html'>SendWheelStraightSpeed</a></h5><p>发送SendWheelStraightSpeed指令至LowLevelAI，机器人将按指令进行直线速度运动。</p><h5><a name='header-n238' class='md-header-anchor '></a>(48) <a href='FuncInterface/SendWheelCycle.html'>SendWheelCycle</a></h5><p>发送SendWheelCycle指令至LowLevelAI，机器人底盘进行位置模式的弧线运动。</p><h5><a name='header-n241' class='md-header-anchor '></a>(49) <a href='FuncInterface/SendWheelCycleSpeed.html'>SendWheelCycleSpeed</a></h5><p>发送SendWheelCycleSpeed指令至LowLevelAI，机器人底盘会进行速度模式的弧线运动。</p><h5><a name='header-n244' class='md-header-anchor '></a>(50) <a href='FuncInterface/SendWheelTransRotSpeed.html'>SendWheelTransRotSpeed</a></h5><p>发送SendWheelTransRotSpeed指令至LowLevelAI，机器人底盘会以给定的角速度线速度运动。</p><h5><a name='header-n247' class='md-header-anchor '></a>(51) <a href='FuncInterface/SendArmFollowTrajectory.html'>SendArmFollowTrajectory</a></h5><p>发送SendArmFollowTrajectory指令至LowLevelAI，机器人将根据轨迹文件进行手臂运动。</p><h5><a name='header-n250' class='md-header-anchor '></a>(52) <a href='FuncInterface/SendArmGoToAngle.html'>SendArmGoToAngle</a></h5><p>发送SendArmGoToAngle指令至LowLevelAI，机器人手臂将依照指定速度运动至指定角度。</p><h5><a name='header-n253' class='md-header-anchor '></a>(53) <a href='FuncInterface/SendArmGoToAngleSync.html'>SendArmGoToAngleSync</a></h5><p>发送SendArmGoToAngleSync指令至LowLevelAI，机器人手臂将依照指定时间运动至指定角度。</p><h5><a name='header-n256' class='md-header-anchor '></a>(54) <a href='FuncInterface/SendArmMoveGripper.html'>SendArmMoveGripper</a></h5><p>发送SendArmMoveGripper指令至LowLevelAI，机器人末端执行器将以默认速度运动至指定位置。</p><h5><a name='header-n259' class='md-header-anchor '></a>(55) <a href='FuncInterface/SendHeadStop.html'>SendArmStop</a></h5><p>发送SendArmStop指令至LowLevelAI，机器人手臂将停止运动并静止在当前位置。</p><h5><a name='header-n262' class='md-header-anchor '></a>(56) <a href='FuncInterface/SendMotorPID.html'>SendMotorPID</a></h5><p>发送SendMotorPID指令至LowLevelAI，机器人将直线行驶。</p><h5><a name='header-n265' class='md-header-anchor '></a>(57) <a href='FuncInterface/SendMotorSpeed.html'>SendMotorSpeed</a></h5><p>发送SendMotorSpeed指令至LowLevelAI，机器人肢体库电机会按指令速度进行运动。</p><h5><a name='header-n268' class='md-header-anchor '></a>(58) <a href='FuncInterface/SendObstAvoid.html'>SendObstAvoid</a></h5><p>发送SendObstAvoid指令至LowLevelAI，打开或者关闭机器人避障。</p><h5><a name='header-n271' class='md-header-anchor '></a>(59) <a href='FuncInterface/PushIntoMsgList.html'>PushIntoMsgList</a></h5><p>向消息队列中插入一条消息。</p><h4><a name='header-n274' class='md-header-anchor '></a>4. 错误码</h4><p>系统提供了对于不同错误的描述，帮助开发者更好的定位问题，<a href='../../OS/EwayOSErrCode.html'>详见</a></p><h4><a name='header-n277' class='md-header-anchor '></a>5. Example</h4><p>FuncSDK中包含CFaceExample、CMarkerExample、CmdExample、MsgExample、MotherFunction及KidFunction 6个example部分。分别通过源码的形式向开发者展示Function的Message机制、Feature机制、Command机制、子Function机制及Timer机制。</p><p><a href='../Example/CFaceExample.html'>CFaceExample</a>展示Message机制（MsgProcCode_Notify处理）。</p><p><a href='../Example/CMarkerExample.html'>CMarkerExample</a>展示Message机制（MsgProcCode_Record处理）。</p><p><a href='../Example/CMsgExample.html'>MsgExample</a>展示Message机制中的自定义消息。</p><p><a href='../Example/CmdExample.html'>CmdExample</a>展示Command机制。</p><p><a href='../Example/CMother-KidExample.html'>MotherFunction及KidFunction</a> 展示子Function机制。</p><h4><a name='header-n290' class='md-header-anchor '></a>6. Demos</h4><p>Demo是一个复杂Function。当前包含<a href='../Example/FeedbackMove.html'>Feedback demo</a>。</p></div>
</body>
</html>